package ravenmocker.core;

public class Column implements IComponent {

	private String componentType = "COLUMN";
	
	private String columnName;
	private String type;
	private Table table;
	private int size;
	private boolean notNull;
	private boolean primaryKey;
	private boolean autoIncrement;
	private String defaultValue;
	
	public Column(String columnName, String type, Table table) {
		this.columnName = columnName;
		this.type = type;
		this.table = table;
	}
	
	public Column(String columnName, String type, int size, Table table) {
		this.columnName = columnName;
		this.type = type;
		this.size = size;
		this.table = table;
	}

	public String getColumnName() {
		return columnName;
	}

	public String getFullyQualifiedName() {
		return table.getComponentName()+"."+columnName;
	}
	
	public void setSize(int size) {
		this.size = size;
	}
	
	public int getSize() {
		return size;
	}
	
	public Table getTable() {
		return table;
	}
	
	public String getTableName() {
		return table.getComponentName();
	}
	
	public String getType() {
		return type;
	}

	public void setIsNotNull(boolean notNull) {
		this.notNull = notNull;
	}
	
	public boolean isNotNull() {
		return notNull;
	}
	
	public void setIsPrimaryKey(boolean primaryKey) {
		this.primaryKey = primaryKey;
	}
	
	public boolean isPrimaryKey() {
		return primaryKey;
	}
	
	public void setIsAutoIncrement(boolean autoIncrement) {
		this.autoIncrement = autoIncrement;
	}
	
	public boolean isAutoIncrement() {
		return autoIncrement;
	}
	
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}
	
	public String getDefaultValue() {
		return defaultValue;
	}

	public String getComponentName() {
		return columnName;
	}

	public String getComponentType() {
		return componentType;
	}


	
}
